﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StatelyCompiler
{
    public static class ObjectExtensions
    {
        public static T As<T>(this object me) where T : class
        {
            return me as T;
        }

        public static bool Is<T>(this object me)
        {
            return me is T;
        }

        public static T To<T>(this object me)
        {
            return (T)me;
        }

        public static bool In<T>(this T me, params T[] set)
        {
            return set.Contains(me);
        }
    }
}
